import parole
from parole.colornames import colors
from parole.display import interpolateRGB
import pygame, random

import sim, main
from util import *
from dungeon import makeFloor, Room, TemplateRoom
import dungeon

template = \
"""
           #*     *#
        ### *  ^  * ###
      ###   *  ^  *   ###
    ##      *  ^  *      ##
   #        *  ^  *        #
  #         *  ^  *         #
##**********O     O**********##
                               
 ^^^^^^^^^          ^^^^^^^^^  
                               
##**********O     O**********##
  #         *     *         #
   #        *     *        #
    ##      *     *      ##
      ###   *     *   ###
        ####*     *####
           #*     *#
           #*     *#
           #*     *#
           #*     *#
           #*     *#
           #*     *#
           #*     *#
           #*     *#
"""[1:]

legend = {
    '^':    parole.map.MapObjectGenerator("", 
            lambda: sim.Obj('grave', 10, parole.map.AsciiTile('^',
                colors['Black']),
                blockMove=False, massNoun=False, startsVowel=False),
            clearFirst=False),

    '*':    parole.map.MapObjectGenerator("", 
            lambda: sim.Obj('dead flowers', 10, parole.map.AsciiTile('*',
                colors['Red']),
                #random.choice([colors['White'], colors['Red'], colors['Blue'],
                #    colors['Violet']])),
                blockMove=True, massNoun=True, startsVowel=False),
            clearFirst=False),

    'O':    parole.map.MapObjectGenerator("", 
            lambda: sim.Obj('granite pillar', 100, parole.map.AsciiTile('O',
                colors['Black']),
                blockMove=True, massNoun=False, startsVowel=False),
            clearFirst=False),

    '#':    dungeon.rockGenerator(colors['DimGray']),
}

floorColor1 = colors['SandyBrown']
floorColor2 = colors['SaddleBrown']
floorName = 'dirt floor'
mixture = 0.5

#diggable = [
#    (4,0), 
#    (4,6),
#    (0,3),
#    (7,3),
#]
diggable = None # means perimeter

class MessHall(TemplateRoom):
    def __init__(self, pos):
        TemplateRoom.__init__(self, template, legend, diggable, pos,
                floorColor1, floorColor2, mixture, floorName)


roomClass = MessHall





